package Screens;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

public class LevelManager {

	int currentLevel = -1;
	String[] levels = new String[2];
	BufferedReader reader;
	String[] words;
	Lines[] lines = new Lines[30];
	public LevelManager(){
		levels[0] = "TestLevel";
		levels[1] = "Level-1";
		changeLevel(0);
		try{
			leveler();
		}catch(Exception ex){}
	}
	void changeLevel(int index){
		currentLevel = index;
	}
	
	void leveler() throws IOException{
		
		try{
			File myFile = new File("Res/Maps/" + levels[currentLevel] + ".txt");
			reader = new BufferedReader(new FileReader(myFile));
			}catch(Exception ex){}
			int number = -1;
			////////////////
			for (String spine = reader.readLine(); spine != null; spine = reader.readLine()) {
			    number++;
				spine = spine.replace(" ", "");
				lines[number] = new Lines(spine);
			    //System.out.println(spine);
			}
			try {
				reader.close();
			} catch (IOException e) {}
	}
}
